<template>
  <div class="app-container">
    <el-form label-width="120px">
      <el-form-item label="资产名称">
        <el-input v-model="asset.title"/>
      </el-form-item>

      <el-form-item label="资产描述">
        <el-input v-model="asset.des"  type="textarea"/>
      </el-form-item>

    <el-form-item label="资产用途">
        <el-input v-model="asset.useMethod"  type="textarea"/>
     </el-form-item>

      <el-form-item>
        <el-button :disabled="saveBtnDisabled" type="primary" @click="saveAsset">保存</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import assetApi from '@/api/asset'
export default {
    data(){
        return{
            asset:{
            }
        }
    },
    created(){
        this.init()
    },
    methods:{
        init(){
            this.asset = {}
        },
       saveAsset(){
            assetApi.addAssetApply(this.asset)
            .then(response => {
               this.$message({
                    type: 'success',
                    message: '申请成功!'
                });
               this.$router.push({path:'/asset_apply'})
            })
            .catch()
        }
    }
}
</script>
